window.onload=function(){
		var log = document.getElementById("order");
		log.onclick=function(){
			var tel = document.getElementById("tel").value;  
			var tasty = $('#tasty').val();
			var type_of_cooking =$('#type_of_cooking').val();
			var hometown = $('#hometown').val();
			
			
			
			console.log(tasty);
			console.log(hometown);
			console.log(type_of_cooking);
			
			var postData = {
							"submit":"确认修改",
							"tel": tel,
							"new_type_of_cooking":type_of_cooking,
							"new_tasty":tasty,
							"new_hometown":hometown 	
					};
						console.log(postData);
						$.post('http://118.89.25.120/alter_info.php', postData, function (data) {
							//console.log(data);
							var obj  = JSON.parse(data.trim());
							//console.log(obj);
							if(obj.success==1)  {
								alert("修改成功");
							} else if (obj.success==0) {
								alert("修改失败");
							} 
						});
			
				/*$.ajax({
					type:"post",
					url:"http://118.89.25.120/login.php",
					async:true,
					dataType:"json",
					data:{submit:"马上注册",tel:tel,taste:taste,like:like,hometown:hometown},
					success:function(e){
			 		window.location.href="prompt.html";
					},
					error:function(e){
						alert("用户名或密码错误，请重新输入");
					}
				});*/
			
			
			
		}
}